package org.app.Enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum ResultCode implements Serializable {

    SUCCESS("00000", "请求成功"),
    FAIL("99999", "系统出错"),
    PARA("11111", "参数校验失败");

    private String code;

    private String msg;

    /**
     * 格式化消息
     *
     * @param param
     * @return
     */
    public String formatMsg(Object... param) {
        return String.format(this.getMsg(), param);
    }

}